package com.haixiaoke.saas.workOrder.mapper;


import com.haixiaoke.saas.workOrder.domain.WorkOrderPerson;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 工单人员信息Mapper接口
 *
 * @author xiaolong
 * @date 2024-09-02
 */
public interface WorkOrderPersonMapper {
    /**
     * 查询工单人员信息
     *
     * @param workOrderPersonId 工单人员信息主键
     * @return 工单人员信息
     */
    WorkOrderPerson selectWorkOrderPersonByWorkOrderPersonId(Long workOrderPersonId);

    /**
     * 查询工单人员信息列表
     *
     * @param workOrderPerson 工单人员信息
     * @return 工单人员信息集合
     */
    List<WorkOrderPerson> selectWorkOrderPersonList(WorkOrderPerson workOrderPerson);

    /**
     * 新增工单人员信息
     *
     * @param workOrderPerson 工单人员信息
     * @return 结果
     */
    int addWorkOrderPerson(WorkOrderPerson workOrderPerson);

    /**
     * 修改工单人员信息
     *
     * @param workOrderPerson 工单人员信息
     * @return 结果
     */
    int updateWorkOrderPerson(WorkOrderPerson workOrderPerson);

    /**
     * 删除工单人员信息
     *
     * @param workOrderPersonId 工单人员信息主键
     * @return 结果
     */
    int deleteWorkOrderPersonByWorkOrderPersonId(Long workOrderPersonId);

    /**
     * 批量删除工单人员信息
     *
     * @param workOrderPersonIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteWorkOrderPersonByWorkOrderPersonIds(Long[] workOrderPersonIds);

    /**
     * 根据工单人员id集合查询工单人员信息
     *
     * @return 工单人员信息集合
     */
    List<WorkOrderPerson> selectWorkOrderPersonByWorkOrderPersonIds(WorkOrderPerson workOrderPerson);

    /**
     * 根据工单人员id集合更新工单人员信息
     *
     * @return 结果
     */
    int updateWorkOrderPersonByWorkOrderPersonIds(Long[] workOrderPersonIds);

    /**
     * 查询工单人员信息和工单信息
     *
     * @param workOrderPerson 工单人员信息
     * @return 工单人员信息集合
     */
    List<WorkOrderPerson> selectWorkOrderPersonAndWorkOrder(WorkOrderPerson workOrderPerson);

    /**
     * 根据B端用户id和租户id查询工单人员信息
     *
     * @param busUserId 业务员id
     * @param tenantId 租户id
     * @return 工单人员信息
     */
    WorkOrderPerson selectWorkOrderPersonByBusUserId(@Param("busUserId") Long busUserId, @Param("tenantId") String tenantId);

    /**
     * 查询工单人员信息及待处理工单数量
     * @param workOrderPerson 工单人员信息
     * @return 工单人员信息
     */
    List<WorkOrderPerson> selectWorkOrderPersonAndPendingWorkOrder(WorkOrderPerson workOrderPerson);

    /**
     * 更新工单人员最新接单时间
     * @param tenantId 工单人员租户id
     * @param busUserId 业务员id
     * @return 结果
     */
    int updateWorkOrderPersonLatestOrderTime(@Param("tenantId") String tenantId, @Param("busUserId") Long busUserId);

}
